#include<bits/stdc++.h>
using namespace std;
// vector<pair<int,int>> paths;
vector<char> dirs;
int n,m;
char maze[1006][1006];
//bool dfs(int,int);
void dfs(int x,int y) {
  if(maze[x][y]=='#')return;
  // if(maze[x][y]=='B') goto SUCC;
  else {
    if(x-1>=0) {
      dirs.push_back('U');
      dfs(x-1,y);
      dirs.pop_back();
    }
    if(y-1>=0) {
      dirs.push_back('L');
      dfs(x,y-1);
      dirs.pop_back();
    }
    if(x+1<n) {
      dirs.push_back('D');
      dfs(x+1,y);
      dirs.pop_back();
    }
    if(y+1<n) {
      dirs.push_back('R');
      dfs(x,y+1);
      dirs.pop_back();
    }
  }
  return;
}
int solve() {
  for(int i=0;i<n;++i)
    for(int j=0;j<m;++j)
      cin>>maze[i][j];

  for(int i=0;i<n;++i)
    for(int j=0;j<m;++j) {
      if(maze[i][j]=='A') {
        dfs(i,j);
        break;
      }
    }

if(dirs.empty()) cout<<"NO\n";
  else {
    cout <<"YES\n";
    cout<<dirs.size()<<"\n";
    for(auto el:dirs) cout<<el;
    cout<<"\n";
  }
  return 0;
}
int main() {
  solve();
  return 0;
}
